1 - x <= exp(-x)


In [17]:
%matplotlib inline

In [22]:
import matplotlib.pyplot as plt

In [1]:
from math import exp

In [10]:
def f1(x): return 1 - x
def f2(x): return exp(-x)

In [11]:
vals = [1e-5, 1e-3, 1e-1, 1, 10, 100]

In [19]:
x_f1 = list(map(f1, vals))
x_f1


Out[19]:
[0.99999, 0.999, 0.9, 0, -9, -99]

In [20]:
x_f2 = list(map(f2, vals))
x_f2


Out[20]:
[0.9999900000499998,
 0.999000499833375,
 0.9048374180359595,
 0.36787944117144233,
 4.5399929762484854e-05,
 3.720075976020836e-44]

In [21]:
list(map(lambda x: f1(x) <= f2(x), vals))


Out[21]:
[True, True, True, True, True, True]

In [26]:
plt.plot(vals, x_f1);
plt.plot(vals, x_f2);



In [29]:
plt.plot(vals, [f2 - f1 for f1, f2 in zip(x_f1, x_f2)]);



In [ ]: